Skip to content

perf(npm): run lifecycle scripts in parallel#32666

Merged
dsherret merged 1 commit intodenoland:mainfrom
dsherret:perf_lifecycle_script_parallel
Mar 12, 2026
Merged

perf(npm): run lifecycle scripts in parallel#32666
dsherret merged 1 commit intodenoland:mainfrom
dsherret:perf_lifecycle_script_parallel

Conversation

@dsherret
Copy link
Member

@dsherret dsherret commented Mar 12, 2026

This constructs a lifecycle script graph then runs npm lifecycle scripts in parallel when able according to that graph.

Installing astro and next:

$ export DENO_DIR="$PWD/deno_dir" ; hyperfine --prepare "rm -rf deno_dir node_modules" "deno install --env-file" "./deno install --env-file"
Benchmark 1: deno install --env-file
  Time (mean ± σ):      4.040 s ±  0.239 s    [User: 1.015 s, System: 1.355 s]
  Range (min … max):    3.666 s …  4.344 s    10 runs

Benchmark 2: ./deno install --env-file
  Time (mean ± σ):      1.999 s ±  0.065 s    [User: 0.985 s, System: 1.437 s]
  Range (min … max):    1.927 s …  2.145 s    10 runs

Summary
  './deno install --env-file' ran
    2.02 ± 0.14 times faster than 'deno install --env-file'

Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

@dsherret dsherret merged commit 8cf29d5 into denoland:main Mar 12, 2026
114 checks passed
@dsherret dsherret deleted the perf_lifecycle_script_parallel branch March 12, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants